﻿using System;
using System.Drawing;

namespace CS_Discovery
{
    /// <summary>
    /// 单个饼图形状项目
    /// </summary>
    /// <remarks>该类型是PieItemCollection列表的成员类型</remarks>
    [System.Serializable()]
    public class PieItem
    {
        /// <summary>
        /// 初始化对象
        /// </summary>
        public PieItem()
        {
        }

        private double dblValue = 0;
        /// <summary>
        /// 数值
        /// </summary>
        public double Value
        {
            get
            {
                return dblValue;
            }
            set
            {
                if (value < 0)
                {
                    throw new ArgumentException("数值必须大于0");
                }
                dblValue = value;
            }
        }

        private string strText = null;
        /// <summary>
        /// 饼图项目文本
        /// </summary>
        public string Text
        {
            get
            {
                return strText;
            }
            set
            {
                strText = value;
            }
        }

        private string strLink = null;
        /// <summary>
        /// 饼图项目链接地址
        /// </summary>
        public string Link
        {
            get
            {
                return strLink;
            }
            set
            {
                strLink = value;
            }
        }

        private Color intColor = Color.Black;
        /// <summary>
        /// 饼图项目颜色
        /// </summary>
        public Color Color
        {
            get
            {
                return intColor;
            }
            set
            {
                intColor = value;
            }
        }

        /// <summary>
        /// 扇形区域的开始角度
        /// </summary>
        internal float StartAngle = 0;
        /// <summary>
        /// 扇形区域的结束角度
        /// </summary>
        internal float EndAngle = 0;
    }//public class PieItem
}